1. Field of the Invention
The present invention relates to a sequence controller which exercises sequence control of a controlled object.
2. Description of the Relevant Art
Sequence controllers for sequence-controlling a controlled object in accordance with a pre-written sequence program are often employed in applications wherein a controlled object is sequence-controlled. SFC (Sequential Function Chart) programs, which will be described later, are frequently used as sequence programs.
FIG. 7 is a block diagram illustrating the arrangement of a conventional sequence controller using an SFC program as a sequence program, wherein the numeral 1 indicates a sequence controller, and 2 a controlled object. Reference numeral 3 indicates a table comprising a process sequence operation table 31, a currently executed step number storage table 32, a step operation program storage table 33 and a transition condition program storage table 34 which will be described later. A process sequence controlling section 4 acts as a process sequence controller. Numeral 7 indicates input and output signals to and from the sequence controller 1. The sequence controller 1 comprises a CPU, a memory and an I/O interface, etc. (not separately shown), on a hardware basis. The process sequence controlling section 4, serving as a process sequence controller, implements functions which are generated when the CPU executes a process sequence control program (an SFC program executing program) stored in the memory. The table 3 and other data such as the sequence program are stored in the memory.
FIG. 8 illustrates an example of a controlled object 2 controlled by the sequence controller 1, wherein 50 indicates a base, 51 and 52 a workpiece A and a workpiece B, respectively, 53 a clamper for the workpiece A 51 or the workpiece B 52, and 54 and 55 a drive motor A and a drive motor B, respectively, provided with machining means for machining the workpiece A 51 or the workpiece B 52. Reference numerals 56-58 indicate limit switches which normally remain OFF (hereinafter referred to as LS1, LS2, LS3, respectively). LS1 56 is turned ON by clamper 53 when workpiece B is set. LS2 57 is turned ON by clamper 53 when workpiece A is set and LS3 58 is turned ON by clamper 53 when workpieces are not set. Reference numbers 59 and 60 designate position detection optical sensors (hereinafter referred to as L1 and L2 respectively) to detect how far the workpieces A 51 and B 52 are shifted from their correct positions, respectively. By receiving the light from an optical (light) source (not illustrated), provided separately, L1 59 will be turned ON when workpiece A 51 is set in the right position but remains turned OFF if it is set off the mark. L2 60 is turned ON when workpiece B 52 is placed in the right position, but remains turned OFF if it is placed in an incorrect position. Numeral 61 indicates a restart button switch (hereinafter referred to as PB).
FIG. 9 illustrates an SFC program example of a sequence program 3 when the controlled object shown in FIG. 8 is controlled by the sequence controller 1. Referring to FIG. 9, S0 indicates a step number of an initial step representing the start of the SFC program; S1 to S7, step numbers of operation steps representing specific control operations; T1 to T8, numbers of transition conditions from one operation step to the next, and J1 a jump destination number for a jump operation. END indicates an END step representing the end of the SFC program.
The operation of the controlled object shown in FIG. 8 will now be described in accordance with the SFC program illustrated in FIG. 9. Control is initiated at the initial step S0 in the SFC program shown in FIG. 9 and the workpiece A 51 is loaded and set in a predetermined position on the base 50. After it is confirmed that the workpiece A 51 has been set at the transition condition T0, the workpiece A 51 is clamped by the clamper 53 at the step S1. After it is confirmed that clamping of workpiece A 51 is completed and that LS2 57, L1 59, and L2 60 are turned ON, confirming that the workpiece is set in a predetermined position at the transition condition T1, the drive motor A 54 is operated at the step S2 to machine the workpiece A 51. After it is confirmed that the workpiece A 51 has been machined at the transition condition T3, the clamper 53 is operated to unclamp the workpiece A 51 at the step S4. After it is confirmed that the workpiece A 51 has been unclamped at the transition condition T5, the workpiece A 51 is unloaded from the base 50 at the step S5. After it is confirmed that the workpiece A 51 has been unloaded at the transition condition T6, this SFC program is terminated at the END step.
When the workpiece B 52 is loaded, the transition condition T2 is enabled in place of the transition condition T1, it is then confirmed that the workpiece B 52 has been clamped, and the drive motor B 55 is operated to machine the workpiece B 52 at the step S3.
FIG. 10 shows the arrangement of the process sequence operation table 31 and the currently executed step number storage table 32, which contains the currently executed step number, in the table 3 shown in FIG. 7.
FIG. 11 shows the arrangement of the step operation program table 33, which indicates tabulated information on step operation programs, and the transition condition program table 34, which indicates tabulated information on transition condition programs, in the table 3. The SFC program is developed in the tables 31, 33 and 34 and retained within the sequence controller 1.
The process sequence operation table 31 (FIG. 10) indicates a tabulated process sequence program from which the sequence controller 1 reads the sequence of control operations performed in accordance with the SFC program shown in FIG. 9. The currently executed step number storage table 32 (FIG. 10) is employed by the sequence controller 1 to store the currently executed step number. The step operation program table 33 (FIG. 11) indicates tabulated information on step operation programs for operation instructions corresponding to the step numbers in the process sequence indicated in the process sequence operation table 31. Finally, the transition condition program table 34 (FIG. 11) indicates tabulated information on transition condition programs acting as transition conditions to subsequent steps corresponding to the process sequence numbers indicated in the process sequence operation table 31.
FIG. 12 is a flowchart for a processing sequence in the process sequence controlling section 4 shown in FIG. 7. The processing sequence for executing the SFC program illustrated in FIG. 9 will now be described with reference to FIG. 12.
In the flowchart shown in FIG. 12, when the process sequence controlling section 4 is activated at step 100, a step number stored in the currently executed step number storage table 32, i.e., the currently executed step number, is set to 0 at step 101. Then, at step 102, the step number C1 stored in the table 32 is read and the step operation program C3 corresponding to that step number is fetched and executed from the step operation program table 33. Further, at step 103, a line on which the executed step number A1 matches the currently executed step number stored in the table 32 is retrieved from the process sequence operation table 31 in order to obtain a next operated step number, and at step 104, the transition condition number A2 on the line where the above step numbers have matched is obtained and the transition condition program D2 corresponding to that number is fetched and executed from the transition condition program table 34.
Then, at step 105, it is checked to see if the transition condition has been enabled. If it has been enabled, the next executed step number is obtained from the next executed step number A3 in the process sequence operation table 31 and stored into the table 32 at step 106, and the processing returns to step 102. If the transition condition has not been enabled at step 105, the processing returns to step 102.
An error occurring at step S1 in the SFC program shown in FIG. 9 will now be described. If an error has taken place at step S1, neither of the transition conditions T1 or T2 is enabled, and the operation stops progressing. To avoid this, error processing is provided in the process sequence program itself. That is, as shown in the arm containing the transition condition T7 through the jump J1 in FIG. 9, a clamp error is checked at the transition condition T7, the workpiece A 51 or workpiece B 52 is unclamped and the cause of the fault is eliminated at the step S7. Then it is confirmed at the transition condition T8 that the fault cause has been removed, the execution thereafter jumps to the step S1 at the jump J1, such that the operation, from step 1 and onward, is repeated. This error processing is marked * in the process sequence operation table 31 in FIG. 10. In case neither the transition condition T1 nor T2 is enabled, that is, when the workpiece has not been set and LS3 58 has been turned ON by the clamper 53, or when either L1 59 or L2 60 has been turned OFF due to an incorrect positioning of either workpiece A 51 or B 52 or when none of the limit switches LS1 56, LS2 57 or LS3 58 has been turned ON even after a pre-determined length of time due, e.g., to a fault of clamper 53 itself, the transition condition of T7 is enabled. Confirmation of the removal of the cause of the fault in the transition condition 78 is made by an operator. The operation restarts with clamping at step 1 after the operator actuates PB 61.
Because the conventional sequence controller is arranged as described above, processing at the occurrence of an error while the sequence program is operational must be described and provided beforehand in the process sequence program itself, so that it can first be determined whether the operation is normal or faulty, and so that, if an error has taken place, the predetermined processing can be performed. It requires much time and labor to write such a program, however, and this increases the size of the overall program.